﻿using BCCommon.OAEnums.WorkflowActive;
using BCEntity.OA.WorkflowActive.WorkflowActive;
using BCEntity.OA.WorkflowActive.WorkflowActivity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCData.OA.WorkflowActivity.WorkflowActivity
{
    /// <summary>
    /// 工作流活动
    /// </summary>
    public interface IWorkflowActivityData
    {
		#region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="workflowActivityId">工作流活动Id</param>
		Task<bool> Exists(long workflowActivityId);
		/// <summary>
		/// 增加工作流活动
		/// </summary>
		/// <param name="entity">工作流活动信息</param>
		Task<WorkflowActivityEntity> Add(WorkflowActivityEntity entity);
		/// <summary>
		/// 更新工作流活动
		/// </summary>
		/// <param name="entity">工作流活动信息</param>
		Task<WorkflowActivityEntity> Update(WorkflowActivityEntity entity);
		/// <summary>
		/// 删除工作流活动
		/// </summary>
		/// <param name="workflowActivityId">工作流活动Id</param>
		Task<bool> Delete(long workflowActivityId);
		/// <summary>
		/// 获取工作流活动
		/// </summary>
		/// <param name="workflowActivityId">工作流活动Id</param>
		Task<WorkflowActivityEntity> GetEntity(long workflowActivityId);
		/// <summary>
		/// 获取工作流活动列表
		/// </summary>
		Task<IEnumerable<WorkflowActivityEntity>> GetList();
		/// <summary>
		/// 获取工作流活动分页列表(待处理任务)
		/// </summary>
		/// <param name="adminId">员工Id</param>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
		/// <param name="sortName">排序字段</param>
		/// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		/// <returns></returns>
		Task<(IEnumerable<WorkflowActivityViewEntity>, int)> PendingHandleTaskQuery(long adminId, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
		/// <summary>
		/// 获取工作流活动分页列表（我发起的，已完成的，已关闭的）
		/// </summary>
		/// <param name="adminId">员工Id</param>
		/// <param name="userId">其他用户Id</param>
		/// <param name="activityStatus">工作流活动状态</param>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
		/// <param name="sortName">排序字段</param>
		/// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		Task<(IEnumerable<WorkflowActivityViewEntity>, int)> Query(long? adminId, long? userId, OAActivityStatus? activityStatus,DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);

		/// <summary>
		/// 更新工作流活动状态为关闭
		/// </summary>
		/// <param name="workflowActivityId">工作流活动Id</param>
		/// <param name="activityStatus">工作流状态</param>
		/// <param name="remark">备注</param>
		/// <returns></returns>
		Task<int> UpdateClosed(long workflowActivityId, OAActivityStatus activityStatus, string remark);
        #endregion  成员方法
    }
}
